		
			var rpcListFlag = false;

			var applicationData;
			var initData;
			var centers;
			
			
			var endDate;
			var endTimestamp;
			var timeScope;
			var startDate;
			var applicationName;
			var serviceTypeCode;
			var limit;
			

			
			$(document).ready(function() {
				appChosen();
				
//				console.log(new Date().getTime() + "----centerChose执行前");
				centerChosen();
//				console.log(new Date().getTime() + "----centerChose执行完开始时间");

				$.get(preUrl + "/getAllCenterInfos", {},
					//				$.get("http://localhost:8041/applications", {},
					function(data) {

//												console.log(data);
						if(data.length != 0) {
							centers = data;
						}
						//						console.log(JSON.stringify(centers));
					});
					
			


				if(getCookie("startTimestamp") != "") {
					applicationName = getCookie("applicationName");
					startDate = getCookie("startTimestamp");
					timeScope = getCookie("timeScope");
					endDate = getCookie("endDate");
					endTimestamp = getCookie("endTimestamp");
					limit = getCookie("limit");
					serviceTypeCode = getCookie("serviceTypeCode");
//					console.log(new Date().getTime() + "----tableShow执行前");
					tableShow();
//					console.log(new Date().getTime() + "----tableShow执行完");

				}
			});
			
		

			function appChosen() {
//				console.log(new Date().getTime() + "----appchoosen前");
				$.get(preUrl + "/applications", {},
					//				$.get("http://localhost:8041/applications", {},
					function(data_selector) {
//						console.log(new Date().getTime() + "----ajax前");
						$("#app_choose").append($("<option hassubinfo='true'>请选择服务...</option>"));
						//						var data_selector = JSON.parse(rs);
						$.each(data_selector, function(i, item) {
							$("#app_choose").append($("<option hassubinfo='true' value='" + data_selector[i].code + "'>" + data_selector[i].applicationName + "</option>"));
						});
						$("#app_choose").chosen();
						
//					console.log(new Date().getTime() + "----ajax后");
					});
//				console.log(new Date().getTime() + "----appchoosen后");
			}
			
		
			function centerChosen() {
				$.get(preUrl + "/centers", {},
					//				$.get("http://localhost:8041/applications", {},
					function(data) {
						$("#center_chosen").append($("<option value='allCenters'>请选择中心...</option>"));
						//						var data_selector = JSON.parse(rs);
						$.each(data, function(i, item) {
							$("#center_chosen").append($("<option value='" + item + "'>" + centerNameToCHN(item) + "</option>"));
						});
					});
			}

			function centerChange() {
				center = $("#center_chosen option:selected").val();
				$.get(preUrl + "/getAppByCenter", {
						center: center
					},
					function(data) {
						//						alert(JSON.stringify(data));
						
						var html = "";

						$.each(data, function(i, item) {
							html  += "<option value='" + item.code + "'>" + item.applicationName + "</option>"
						});
						
						
						$("#app_choose").empty().append(html).trigger("chosen:updated");
						
					});
			}

			function typeChange() {
				center = $("#center_chosen option:selected").val();
				type = $("#type_chosen option:selected").val();
				$.get(preUrl + "/getAppByCenterAndType", {
						center: center,
						type: type
					},
					function(data) {
						//						alert(JSON.stringify(data));
						var html = "";

						$.each(data, function(i, item) {
							html  += "<option value='" + item.code + "'>" + item.applicationName + "</option>"
						});
						
						
						$("#app_choose").empty().append(html).trigger("chosen:updated");
					});
			}



			function errorList() {

				var data;
				if(data == undefined) {
					data = initData;
				} else {
					data = applicationData;
				}

				if(rpcListFlag == true) {
					$("#rpc_tb").dataTable().fnDestroy();
				}

				$("#rpc_tb").empty();
				$("#rpc_tb").append($("<thead><tr><th>序号</th><th>开始时间</th><th>RPC请求</th><th>是否异常</th><th>请求耗时(ms)</th><th>实例名</th><th>客户端IP</th><th>事务唯一标识</th></tr></thead><tbody>"));
				$.each(data, function(i, item) {
					var exceptionFlag = false;
					var startTime = getFormatDate(data[i].startTime);
					$.each(data[i].spanEventBoList, function(j, spanEventBo) {
						if(spanEventBo.exceptionId != 0) {
							exceptionFlag = true;
						}

					});
					if(exceptionFlag) {
						if(data[i].elapsed < 1000) {
							td = $("<tr onmouseover=\"this.style.background='White'\" onmouseout=\"this.style.background='#FFD2D2'\" style='background-color: #FFD2D2;' onClick=\"location.href='trans_info.html?exceptionFlag=" + exceptionFlag + "&traceId=" + data[i].transactionId.agentId + '%5E' + data[i].transactionId.agentStartTime + '%5E' + data[i].transactionId.transactionSequence + "&focusTimestamp=" + data[i].collectorAcceptTime +  "&agentId=" + data[i].agentId + "&spanId=" + data[i].spanId + "&mRpc=" + data[i].rpc + "'\"><td>" + (i + 1) +
								"<td><i class='fa fa-clock-o'></i> " + getFormatDate(data[i].startTime) +
								"<td>" + data[i].rpc +
								"</td><td>异常</td><td class='text-navy'>" + data[i].elapsed +
								"</td><td>" + data[i].agentId +
								"</td><td>" + data[i].remoteAddr +
								"</td><td>" + data[i].transactionId.agentId + '%5E' + data[i].transactionId.agentStartTime + '%5E' + data[i].transactionId.transactionSequence + "</td></tr>");
							$("#rpc_tb").append(td);
						} else if(data[i].elapsed > 5000) {
							td = $("<tr onmouseover=\"this.style.background='White'\" onmouseout=\"this.style.background='#FFD2D2'\" style='background-color: #FFD2D2;' onClick=\"location.href='trans_info.html?exceptionFlag=" + exceptionFlag + "&traceId=" + data[i].transactionId.agentId + '%5E' + data[i].transactionId.agentStartTime + '%5E' + data[i].transactionId.transactionSequence + "&focusTimestamp=" + data[i].collectorAcceptTime +  "&agentId=" + data[i].agentId + "&spanId=" + data[i].spanId + "&mRpc=" + data[i].rpc + "'\"><td>" + (i + 1) +
								"<td><i class='fa fa-clock-o'></i> " + getFormatDate(data[i].startTime) +
								"<td>" + data[i].rpc +
								"<</td><td>异常</td><td class='text-danger'>" + data[i].elapsed +
								"</td><td>" + data[i].agentId +
								"</td><td>" + data[i].remoteAddr +
								"</td><td>" + data[i].transactionId.agentId + '%5E' + data[i].transactionId.agentStartTime + '%5E' + data[i].transactionId.transactionSequence + "</td></tr>");
							$("#rpc_tb").append(td);
						} else {
							td = $("<tr onmouseover=\"this.style.background='White'\" onmouseout=\"this.style.background='#FFD2D2'\" style='background-color: #FFD2D2;' onClick=\"location.href='trans_info.html?exceptionFlag=" + exceptionFlag + "&traceId=" + data[i].transactionId.agentId + '%5E' + data[i].transactionId.agentStartTime + '%5E' + data[i].transactionId.transactionSequence + "&focusTimestamp=" + data[i].collectorAcceptTime +  "&agentId=" + data[i].agentId + "&spanId=" + data[i].spanId + "&mRpc=" + data[i].rpc + "'\"><td>" + (i + 1) +
								"<td><i class='fa fa-clock-o'></i> " + getFormatDate(data[i].startTime) +
								"<td>" + data[i].rpc +
								"</td><td>异常</td><td class='text-warning'>" + data[i].elapsed +
								"</td><td>" + data[i].agentId +
								"</td><td>" + data[i].remoteAddr +
								"</td><td>" + data[i].transactionId.agentId + '%5E' + data[i].transactionId.agentStartTime + '%5E' + data[i].transactionId.transactionSequence + "</td></tr>");
							$("#rpc_tb").append(td);

						}

					}

				});
				$("#rpc_tb").append("</tbody>");
				$('#rpc_tb').dataTable({
					"aoColumnDefs": [{
						"bSortable": false,
						"aTargets": [0, 2, 3, 5, 6, 7]

					}]
				});

				rpcListFlag = true;

			}

			var nodeList = {};

			var cookieFlag = false;

			function checkDate() {
				cookieFlag = true;
			}

			function appChange() {
				cookieFlag = true;
			}
			
		

			function tableShow() {
				
				
				
				
//				console.log(new Date().getTime() + "----tableShow开始");

				var instanceName = new Array();
				//				var startDate = new Date($("#start").val());

				if(getCookie("startTimestamp") == "NaN" || getCookie("startTimestamp") == "") {
					endDate = new Date($("#end").val());
					endTimestamp = Date.parse(new Date($("#end").val()));
					timeScope = $("#timeScope").val();
					startDate = getStartTime(timeScope, endTimestamp);
					applicationName = $("#app_choose option:selected").text();
					serviceTypeCode = $("#app_choose").val();
					
					
					if($("#limit").val() == "请选择显示条数...") {
						limit = 1000;
					} else {
						limit = parseInt($("#limit").val());
					}

				}

				if(cookieFlag) {
					delCookie("applicationName");
					delCookie("startTimestamp");
					delCookie("timeScope");
					delCookie("endDate");
					delCookie("endTimestamp");
					delCookie("limit");
					delCookie("serviceTypeCode");

					endDate = new Date($("#end").val());

					endTimestamp = Date.parse(new Date($("#end").val()));
					timeScope = $("#timeScope").val();
					startDate = getStartTime(timeScope, endTimestamp);
					applicationName = $("#app_choose option:selected").text();
					serviceTypeCode = $("#app_choose").val();
					if($("#limit").val() == "请选择显示条数...") {
						limit = 1000;
					} else {
						limit = parseInt($("#limit").val());
					}
				}
				

				//				$("#start").val() = $("#end").val()
				//				var a = $("#app_choose").val();
				//				var b = applicationName;
				//				$.get("http://10.145.196.107:8041/transactionListForConditions", {
				//				console.log(Date.parse(new Date()));
				$("#titleInfo").text(" 调用关系拓扑图  [" + applicationName + "]");
//				console.log(new Date().getTime() + "----散点开始");
				$.get(preUrl + "/transactionListForConditions", {
						//				$.get("http://localhost:8041/transactionListForConditions", {
						applicationName: applicationName,
						startTimestamp: startDate,
						endTimestamp: Date.parse(endDate),
						limit: limit
					},
					function(data) {
						var agentIds = new Array();

						initData = data;
					
//						console.log(JSON.stringify(data));

						//						var data = JSON.parse(rs);

						$.each(data, function(i, item) {
							agentIds.push(data[i].agentId);
						});
						instanceName = $.unique(agentIds);

						var instanceDataArray = [];

						$.each(instanceName, function(i, instance) {
							var instanceData = {};
							instanceData['name'] = instance;
							instanceData['type'] = "scatter";
							var coordinate = [];
							$.each(data, function(j, item) {
								if(instance == item.agentId) {
									coordinate[j] = [new Date(parseInt(data[j].startTime)), data[j].elapsed];

								}
							});
							instanceData['data'] = coordinate;
							instanceData['markPoint'] = {
								data: [{
									type: 'max',
									name: '最大值'

								}]
							};

							instanceData['markLine'] = {
								data: [{
									type: 'average',
									name: '平均值'
								}]
							};

							instanceDataArray.push(instanceData);

						});
						var name = "服务 [ " + applicationName + " ] 请求耗时";

						var rpc_sc = echarts.init(document.getElementById("rpc_scatter_chart"));
						var scatterOption = {
							title: {
								subtext: name
							},
							tooltip: {
								trigger: 'axis',
								showDelay: 0,
								formatter: function(params) {

									if(params.value.length > 1) {
										return params.seriesName + ' : ' +
											params.value[1] + 'ms<br/>' +
											params.value[0] + '';
									} else {
										return params.seriesName + ' - ' +
											params.name + ' : ' +
											params.value + 'ms';
									}
								},
								axisPointer: {
									show: true,
									type: 'cross',
									lineStyle: {
										type: 'dashed',
										width: 1
									}
								}
							},
							legend: {
								//---动态数据
								data: instanceName
							},
							toolbox: {
								show: true,
								feature: {

									restore: {
										show: true
									}
								}
							},
							grid: {
								x: 55,
								x2: 55,
								y: 120,
								y2: 40
							},
							xAxis: [{
								type: 'time',
								min: getFormatDate(startDate),
								max: endDate
							}],
							yAxis: [{
								type: 'value',
								name: 'ms',
								axisLabel: {
									formatter: '{value}'
								}
							}],
							// ---- 动态数据------
							series: instanceDataArray
						};

						rpc_sc.setOption(scatterOption);
						$(window).resize(rpc_sc.resize);

						if(rpcListFlag == true) {
							$("#rpc_tb").dataTable().fnDestroy();
						}

						$("#rpc_tb").empty();
						$("#rpc_tb").append($("<thead><tr><th>序号</th><th>开始时间</th><th>RPC请求</th><th>是否异常</th><th>请求耗时(ms)</th><th>实例名</th><th>客户端IP</th><th>事务唯一标识</th></tr></thead><tbody>"));
						$.each(data, function(i, item) {
							var exceptionFlag = false;
							var startTime = getFormatDate(data[i].startTime);
							$.each(data[i].spanEventBoList, function(j, spanEventBo) {
								if(spanEventBo.exceptionId != 0) {
									exceptionFlag = true;
								}

							});

							if(exceptionFlag) {
								td = $("<tr onmouseover=\"this.style.background='White'\" onmouseout=\"this.style.background='#FFD2D2'\" style='background-color: #FFD2D2;' onClick=\"location.href='trans_info.html?exceptionFlag=" + exceptionFlag + "&traceId=" + data[i].transactionId.agentId + '%5E' + data[i].transactionId.agentStartTime + '%5E' + data[i].transactionId.transactionSequence + "&focusTimestamp=" + data[i].collectorAcceptTime +  "&agentId=" + data[i].agentId + "&spanId=" + data[i].spanId + "&mRpc=" + data[i].rpc + "'\"><td>" + (i + 1) +
									"<td><i class='fa fa-clock-o'></i> " + getFormatDate(data[i].startTime) +
									"<td><a href=\"trans_info.html?exceptionFlag=" + exceptionFlag + "&traceId=" + data[i].transactionId.agentId + '%5E' + data[i].transactionId.agentStartTime + '%5E' + data[i].transactionId.transactionSequence + "&focusTimestamp=" + data[i].collectorAcceptTime +  "&agentId=" + data[i].agentId + "&spanId=" + data[i].spanId + "&mRpc=" + data[i].rpc + "\">" + data[i].rpc +
									"</a></td><td class='text-danger'>异常</td><td class='text-navy'>" + data[i].elapsed +
									"</td><td>" + data[i].agentId +
									"</td><td>" + data[i].remoteAddr +
									"</td><td>" + data[i].transactionId.agentId + '%5E' + data[i].transactionId.agentStartTime + '%5E' + data[i].transactionId.transactionSequence + "</td></tr>");
								$("#rpc_tb").append(td);

							} else {
								if(data[i].elapsed < 1000) {
									td = $("<tr onClick=\"location.href='trans_info.html?traceId=" + data[i].transactionId.agentId + '%5E' + data[i].transactionId.agentStartTime + '%5E' + data[i].transactionId.transactionSequence + "&focusTimestamp=" + data[i].collectorAcceptTime +  "&agentId=" + data[i].agentId + "&spanId=" + data[i].spanId + "&mRpc=" + data[i].rpc + "'\"><td>" + (i + 1) +
										"<td><i class='fa fa-clock-o'></i> " + getFormatDate(data[i].startTime) +
										"<td><a href=\"trans_info.html?traceId=" + data[i].transactionId.agentId + '%5E' + data[i].transactionId.agentStartTime + '%5E' + data[i].transactionId.transactionSequence + "&focusTimestamp=" + data[i].collectorAcceptTime +  "&agentId=" + data[i].agentId + "&spanId=" + data[i].spanId + "&mRpc=" + data[i].rpc + "\">" + data[i].rpc +
										"</a></td><td>正常</td><td class='text-navy'>" + data[i].elapsed +
										"</td><td>" + data[i].agentId +
										"</td><td>" + data[i].remoteAddr +
										"</td><td>" + data[i].transactionId.agentId + '%5E' + data[i].transactionId.agentStartTime + '%5E' + data[i].transactionId.transactionSequence + "</td></tr>");
									$("#rpc_tb").append(td);
								} else if(data[i].elapsed > 5000) {
									td = $("<tr onClick=\"location.href='trans_info.html?traceId=" + data[i].transactionId.agentId + '%5E' + data[i].transactionId.agentStartTime + '%5E' + data[i].transactionId.transactionSequence + "&focusTimestamp=" + data[i].collectorAcceptTime +  "&agentId=" + data[i].agentId + "&spanId=" + data[i].spanId + "&mRpc=" + data[i].rpc + "'\"><td>" + (i + 1) +
										"<td><i class='fa fa-clock-o'></i> " + getFormatDate(data[i].startTime) +
										"<td><a href=\"trans_info.html?traceId=" + data[i].transactionId.agentId + '%5E' + data[i].transactionId.agentStartTime + '%5E' + data[i].transactionId.transactionSequence + "&focusTimestamp=" + data[i].collectorAcceptTime +  "&agentId=" + data[i].agentId + "&spanId=" + data[i].spanId + "&mRpc=" + data[i].rpc + "\">" + data[i].rpc +
										"</a></td><td>正常</td><td class='text-danger'>" + data[i].elapsed +
										"</td><td>" + data[i].agentId +
										"</td><td>" + data[i].remoteAddr +
										"</td><td>" + data[i].transactionId.agentId + '%5E' + data[i].transactionId.agentStartTime + '%5E' + data[i].transactionId.transactionSequence + "</td></tr>");
									$("#rpc_tb").append(td);
								} else {
									td = $("<tr onClick=\"location.href='trans_info.html?traceId=" + data[i].transactionId.agentId + '%5E' + data[i].transactionId.agentStartTime + '%5E' + data[i].transactionId.transactionSequence + "&focusTimestamp=" + data[i].collectorAcceptTime +  "&agentId=" + data[i].agentId + "&spanId=" + data[i].spanId + "&mRpc=" + data[i].rpc + "'\"><td>" + (i + 1) +
										"<td><i class='fa fa-clock-o'></i> " + getFormatDate(data[i].startTime) +
										"<td><a href=\"trans_info.html?traceId=" + data[i].transactionId.agentId + '%5E' + data[i].transactionId.agentStartTime + '%5E' + data[i].transactionId.transactionSequence + "&focusTimestamp=" + data[i].collectorAcceptTime +  "&agentId=" + data[i].agentId + "&spanId=" + data[i].spanId + "&mRpc=" + data[i].rpc + "\">" + data[i].rpc +
										"</a></td><td>正常</td><td class='text-warning'>" + data[i].elapsed +
										"</td><td>" + data[i].agentId +
										"</td><td>" + data[i].remoteAddr +
										"</td><td>" + data[i].transactionId.agentId + '%5E' + data[i].transactionId.agentStartTime + '%5E' + data[i].transactionId.transactionSequence + "</td></tr>");
									$("#rpc_tb").append(td);

								}

							}

						});
						$("#rpc_tb").append("</tbody>");
						$('#rpc_tb').dataTable({
							"aoColumnDefs": [{
								"bSortable": false,
								"aTargets": [0, 2, 3, 5, 6, 7]

							}]
						});
						rpcListFlag = true;
					});
//				console.log(new Date().getTime() + "----散点结束，拓扑图开始");

				//				var applicationName = applicationName;

				var from = startDate;
				var to = Date.parse(endDate);

				$.get(preUrl + "/getServerMapDataDetail", {
						//				$.get("http://localhost:8041/getServerMapDataDetail", {
						applicationName: applicationName,
						serviceTypeCode: serviceTypeCode,
						from: from,
						to: to
					},
					function(data1) {
//						console.log(data1);

						var obj = JSON.parse(data1);

						var nodeArray = [];
						var linkArray = [];
						var temp1 = {
							symbol: 'image://http://www.damndigital.com/wp-content/uploads/2010/12/steve-jobs.jpg',
							symbolSize: [60, 35],
							draggable: true
						};
						nodeArray.push(temp1);

						nodeList = obj.nodeDataArray;
						var linkList = obj.linkDataArray;
						var nodeMap = {};

						//						var agentIdsStr = JSON.stringify(agentIds);

						$.each(nodeList, function(i, item) {
							var RTSCount = 0;
							$.each(linkList, function(j, link) {
								if(item.key == link.from) {
									RTSCount = RTSCount + link.totalCount;
								}

							});

							if(applicationName == item.applicationName) {
								$("#applicationName").empty();
								$("#RTSCount").empty();
								$("#responseCount").empty();
								$("#errorCount").empty();
								$("#instanceCount").empty();

								//								var href = "agentInfo.html?applicationName="+ applicationName +"&startTimestamp="+ startDate +"&endTimestamp="+ Date.parse(endDate) +"&limit="+ limit;
								//								$("#agentInfoButton").append($("<h4 class='no-paging' ><a id='agentIds' href=\"agentInfo.html?applicationName="+ applicationName +"&startTimestamp="+ startDate +"&endTimestamp="+ Date.parse(endDate) +"&limit="+ limit +"\"><button>实例信息</button></a></h4>"));

								$("#applicationName").append($("<h4 class='no-paging' >服务 : " + item.applicationName + "</h4>"));
								$("#responseCount").append($('<h4>响应次数 : ' + item.totalCount + '</h4>'));
								$("#RTSCount").append($('<h4>RTS : ' + RTSCount + '</h4>'));
								$("#errorCount").append($('<h4 ><a id="error" href="#rpc_tb"  onclick="errorList()" class="text-danger"><u>Error : ' + item.errorCount + '</u></a></h4>'));
								$("#instanceCount").append($("<h4>实例数 : " + item.instanceCount + "&nbsp;&nbsp;&nbsp;&nbsp;<a id='agentIds' href=\"agentInfo.html?applicationName=" + applicationName + "&startTimestamp=" + startDate + "&endTimestamp=" + Date.parse(endDate) + "&limit=" + limit + "\"><button>实例进程信息</button></h4>"));

							}

						});

						var yyy = 0;
						var xxx = 0;

						$.each(linkList, function(j, link) {
							$.each(nodeList, function(i, node) {

								yyy = Math.floor(Math.random() * 350 + 100);
								xxx = Math.floor(Math.random() * 500 + 150);

								if(node.key == link.from) {
									if(!(node.isWas)) {
										if(node.serviceTypeCode == 2 || node.serviceTypeCode == "2") {
											var sourceV = {
												category: 1,
												symbol: getImg(node.serviceTypeCode, node.applicationName),
												name: node.key,
												initial: [50, yyy],
												fixX: true,
												fixY: true,
												label: node.applicationName,
												value: 1
											};
										} else {
											var sourceV = {
												category: 1,
												symbol: getImg(node.serviceTypeCode, node.applicationName),
												name: node.key,
												initial: [700, yyy],
												fixX: true,
												fixY: true,
												label: node.applicationName,

												value: 1
											};
										}

									} else {
										var sourceV = {
											category: 1,
											symbol: getImg(node.serviceTypeCode, node.applicationName),
											name: node.key,
											label: node.applicationName,
											initial: [xxx, yyy],
											fixX: true,
											fixY: true,

											value: 1
										};

									}

									nodeMap[node.key] = sourceV;
									sourceK = node.key;
								} else if(node.key == link.to) {
									if(!(node.isWas)) {
										if(node.serviceTypeCode == 2 || node.serviceTypeCode == "2") {
											var targetV = {
												category: 1,
												symbol: getImg(node.serviceTypeCode, node.applicationName),
												name: node.key,
												initial: [50, yyy],
												fixX: true,
												fixY: true,
												label: node.applicationName,
												value: 1
											};
										} else {
											var targetV = {
												category: 1,
												symbol: getImg(node.serviceTypeCode, node.applicationName),
												name: node.key,
												initial: [700, yyy],
												fixX: true,
												fixY: true,

												label: node.applicationName,
												value: 1
											};
										}

									} else {
										var targetV = {
											category: 1,
											symbol: getImg(node.serviceTypeCode, node.applicationName),
											name: node.key,
											label: node.applicationName,
											initial: [xxx, yyy],
											fixX: true,
											fixY: true,
											value: 1
										};

									}

									nodeMap[node.key] = targetV;
									targetK = node.key;

								}
							});
							//							alert(targetK.aaa);
							
//							console.log(JSON.stringify(link));
							linkData = {
								source: sourceK,
								target: targetK,

								weight: 2,
								itemStyle: {
									normal: {
										color: '#D3D3D3',

										text: link.totalCount,
										textColor: '#D3D3D3',
										textFont: 'bold 12px verdana',
										textPosition: 'inside'
									}
								}
							};

							linkArray.push(linkData);
						});

						//						nodeArray = ClearNullArr(nodeArray);

						$.each(nodeMap, function(i, node) {
							if(node.name == getKeyByName(applicationName)) {
								node.symbol = getImg2(getCodeByName(applicationName), applicationName);
							}

						});

						for(var key in nodeMap) {

							nodeArray.push(nodeMap[key]);
						}

						//						console.log(JSON.stringify(nodeArray));
						//						console.log(JSON.stringify(linkArray));

						var nodeMap2 = {};
						var nodeName = getKeyByName(applicationName);
						$.each(nodeArray, function(j, node) {
							if(nodeName == node.name) {
								nodeMap2[nodeName] = node;

							}

						});

						//						for(var a = 0; a < linkArray.length; a++) {

						var tempArrayList = getNode(nodeName, linkArray);
						$.each(tempArrayList, function(i, item) {
							$.each(nodeArray, function(j, node) {
								if(item == node.name) {
									nodeMap2[item] = node;

								}

							});

							var temp1 = getNode(item, linkArray);
							$.each(temp1, function(k, item1) {
								$.each(nodeArray, function(l, node1) {
									if(item1 == node1.name) {
										nodeMap2[item1] = node1;

									}

								});
								/*	var temp2 = getNode(item1, linkArray);
									$.each(temp2, function(m, item2) {
										$.each(nodeArray, function(l, node1) {
											if(item2 == node1.name) {
												nodeMap2[item2] = node1;

											}

										});
									});*/
							});

						});

						var tempTargetList = getNodeByTarget(nodeName, linkArray);
						$.each(tempTargetList, function(i, item) {
							$.each(nodeArray, function(j, node) {
								if(item == node.name) {
									nodeMap2[item] = node;

								}

							});

							var temp1 = getNodeByTarget(item, linkArray);
							$.each(temp1, function(k, item1) {
								$.each(nodeArray, function(l, node1) {
									if(item1 == node1.name) {
										nodeMap2[item1] = node1;

									}

								});

								var temp2 = getNodeByTarget(item1, linkArray);
								$.each(temp2, function(m, item2) {
									$.each(nodeArray, function(l, node1) {
										if(item2 == node1.name) {
											nodeMap2[item2] = node1;

										}

									});
								});
							});

						});

						//						console.log(JSON.stringify(tempArrayList));

						$.each(linkArray, function(i, link) {

							if(nodeName == link.source) {
								$.each(nodeArray, function(j, node) {
									if(nodeName == node.name) {
										//											nodeMap2[link.target] = node;

									}
									nodeName = link.target;

								});

							}
						});

						//						}

						//						console.log(JSON.stringify(nodeMap2));

						$.each(nodeMap2, function(i, node) {
							if(node.name == getKeyByName(applicationName)) {
								node.symbol = getImg2(getCodeByName(applicationName), applicationName);
							}

						});

						var nodeArray1 = [];

						for(var key in nodeMap2) {

							nodeArray1.push(nodeMap2[key]);
						}

						function getNodeByName(name) {
							$.each(nodeArray, function(j, node) {
								if(name == node.name) {
									return node;
								}

							});
						}

						function getNode(nodeName, linkArray) {
							var tempNodeArray = [];
							$.each(linkArray, function(i, link) {
								if(nodeName == link.source) {
									tempNodeArray.push(link.target);
								}

							});
							return tempNodeArray;
						}

						function getNodeByTarget(nodeName, linkArray) {
							var tempNodeArray = [];
							$.each(linkArray, function(i, link) {
								if(nodeName == link.target) {
									tempNodeArray.push(link.source);
								}

							});
							return tempNodeArray;
						}

						function getKeyByName(name) {
							var key;
							$.each(nodeList, function(j, node) {
								if(name == node.applicationName) {
									key = node.key;
								}

							});

							return key;
						}

						function getCodeByName(name) {
							var code;
							$.each(nodeList, function(j, node) {
								if(name == node.applicationName) {
									code = node.serviceTypeCode;
								}

							});

							return code;
						}
						//						alert(getKeyByName(applicationName));

						/*$.each(linkArray, function(i, link) {
								
									if(node.name == link.source){
										nodeMap2[link.target] = node;
									}
							
								
							});*/
						var textName = "全部调用链";
						if($("#showType").val() == 1 || $("#showType").val() == "1") {
							nodeArray = nodeArray1;
							textName = "基于服务调用链";
						}

						var myChart = echarts.init(document.getElementById("rpc_link_chart"));
						var option = {
							title: {
								text: textName
							},

							toolbox: {
								show: true,
								feature: {
									restore: {
										show: true
									}
								}
							},
							series: [{
								type: 'force',
								name: "服务",
								ribbonType: false,

								itemStyle: {
									normal: {
										label: {
											show: true,
											position: 'bottom',
											textStyle: {
												color: 'black',
												baseline: 'left',
												fontStyle: 'normal', //文字字体的风格 'normal'标准 'italic'斜体 'oblique' 倾斜
												fontWeight: 'bolder', //'normal'标准'bold'粗的'bolder'更粗的'lighter'更细的或100 | 200 | 300 | 400...
												fontFamily: 'sans-serif', //文字的字体系列
												fontSize: 12 //字体大小
											}
										},
										nodeStyle: {

											borderColor: 'red',
											borderWidth: 2
										}
									},
									emphasis: {
										label: {
											show: false
												// textStyle: null      // 默认使用全局文本样式，详见TEXTSTYLE
										},
										nodeStyle: {
											// r: 30

										},
										linkStyle: {}
									}
								},

								gravity: 3,
								scaling: 3,
								draggable: true,
								center: ['20%', '50%'],
								linkSymbol: 'arrow',
								symbolSize: 30,
								linkSymbolSize: [10, 15],
								steps: 10,
								coolDown: 0.9,
								//preventOverlap: true,
								nodes: nodeArray,

								links: linkArray
							}]
						};
						var barChart = echarts.init(document.getElementById("rpc_bar_chart"));
						var countArray = [];
						$.each(nodeList, function(i, item) {
							if(applicationName == item.applicationName) {

								countArray.push(item.histogram['1s']);
								countArray.push(item.histogram['3s']);
								countArray.push(item.histogram['5s']);
								countArray.push(item.histogram.Slow);
								countArray.push(item.histogram.Error);
							}
						});

						var barOption = {

							tooltip: {
								trigger: 'axis'
							},

							calculable: true,
							grid: {
								x: 40,
								x2: 15,
								y: 20,
								y2: 60
							},
							xAxis: [{
								type: 'category',
								data: ["1s", "3s", "5s", "Slow", "Error"],
							}],
							yAxis: [{
								type: 'value'
							}],
							series: [{
									name: '次数',
									type: 'bar',
									itemStyle: {
										normal: {
											color: function(params) {
												// build a color map as your need.
												var colorList = [
													'#ADD8E6', '#B0E0E6', '	#90EE90', '	#FFD700', '	#FF0000'
												];
												return colorList[params.dataIndex]
											},
											label: {
												show: true,
												position: 'top'

											}
										}
									},
									data: countArray
								},

							]
						};

						barChart.setOption(barOption);

						myChart.setOption(option);
						myChart.refresh();

						myChart.on('click', function(params) {
							tableShow2(params);

						});
						myChart.setOption(option);

						function focus(param) {
							var data = param.data;
							var links = option.series[0].links;
							var nodes = option.series[0].nodes;
							if(
								data.source != null &&
								data.target != null
							) { //点击的是边
								var sourceNode = nodes.filter(function(n) {
									return n.name == data.source
								})[0];
								var targetNode = nodes.filter(function(n) {
									return n.name == data.target
								})[0];
								console.log("选中了边 " + sourceNode.name + ' -> ' + targetNode.name + ' (' + data.weight + ')');
							} else { // 点击的是点
								console.log("选中了" + data.name + '(' + data.value + ')');
							}
						}

					});

				setCookie("applicationName", applicationName, 30);
				setCookie("startTimestamp", startDate, 30);
				setCookie("timeScope", timeScope, 30);
				setCookie("endDate", endDate, 30);
				setCookie("endTimestamp", Date.parse(endDate), 30);
				setCookie("limit", limit, 30);
				setCookie("serviceTypeCode", serviceTypeCode, 30);

//				console.log(new Date().getTime() + "----拓扑图结束，tableShow结束");

			}

			function getNameByKey(key) {
				var name;
				$.each(nodeList, function(i, item) {
					if(key == item.key) {
						name = item.applicationName;

					}

				});
				return name;

			}

			function tableShow2(params) {
//				console.log(new Date().getTime() + "----点击开始时间");

				var applicationName = getNameByKey(params.name);

				/*var endDate = new Date($("#end").val());
				var endTimestamp = Date.parse(new Date($("#end").val()));
				var timeScope = $("#timeScope").val();
				var startDate = getStartTime(timeScope, endTimestamp);*/
				if($("#limit").val() == "请选择显示条数...") {
					var limit = 1000;
				} else {
					var limit = parseInt($("#limit").val());
				}

				$("#titleInfo").text(" 调用关系拓扑图  [" + applicationName + "]");
//				console.log(new Date().getTime() + "----散点开始");

				$.get(preUrl + "/transactionListForConditions", {
						//				$.get("http://localhost:8041/transactionListForConditions2", {
						applicationName: applicationName,
						startTimestamp: startDate,
						endTimestamp: Date.parse(endDate),
						limit: limit
					},
					function(data) {

						initData = data;

						var agentIds = new Array();

						$.each(data, function(i, item) {
							agentIds.push(data[i].agentId);
						});
						var instanceName = $.unique(agentIds);

						var instanceDataArray = [];

						$.each(instanceName, function(i, instance) {
							var instanceData = {};
							instanceData['name'] = instance;
							instanceData['type'] = "scatter";
							var coordinate = [];
							$.each(data, function(j, item) {
								if(instance == item.agentId) {
									coordinate[j] = [new Date(parseInt(data[j].startTime)), data[j].elapsed];

								}
							});
							instanceData['data'] = coordinate;
							instanceData['markPoint'] = {
								data: [{
									type: 'max',
									name: '最大值'

								}]
							};

							instanceData['markLine'] = {
								data: [{
									type: 'average',
									name: '平均值'
								}]
							};

							instanceDataArray.push(instanceData);

						});
						var name = "服务 [ " + applicationName + " ] 请求耗时";

						var rpc_sc = echarts.init(document.getElementById("rpc_scatter_chart"));
						var scatterOption = {
							title: {
								subtext: name
							},
							tooltip: {
								trigger: 'axis',
								showDelay: 0,
								formatter: function(params) {

									if(params.value.length > 1) {
										return params.seriesName + ' : ' +
											params.value[1] + 'ms<br/>' +
											params.value[0] + '';
									} else {
										return params.seriesName + ' - ' +
											params.name + ' : ' +
											params.value + 'ms';
									}
								},
								axisPointer: {
									show: true,
									type: 'cross',
									lineStyle: {
										type: 'dashed',
										width: 1
									}
								}
							},
							legend: {
								//---动态数据
								data: instanceName
							},
							toolbox: {
								show: true,
								feature: {

									restore: {
										show: true
									}
								}
							},
							grid: {
								x: 55,
								x2: 55,
								y: 120,
								y2: 40
							},
							xAxis: [{
								type: 'time',
								min: getFormatDate(startDate),
								max: endDate
							}],
							yAxis: [{
								type: 'value',
								name: 'ms',
								axisLabel: {
									formatter: '{value}'
								}
							}],
							// ---- 动态数据------
							series: instanceDataArray
						};

						rpc_sc.setOption(scatterOption);
						$(window).resize(rpc_sc.resize);

						if(rpcListFlag == true) {
							$("#rpc_tb").dataTable().fnDestroy();
						}

						$("#rpc_tb").empty();
						$("#rpc_tb").append($("<thead><tr><th>序号</th><th>开始时间</th><th>RPC请求</th><th>是否异常</th><th>请求耗时(ms)</th><th>实例名</th><th>客户端IP</th><th>事务唯一标识</th></tr></thead><tbody>"));
						$.each(data, function(i, item) {
							var exceptionFlag = false;
							var startTime = getFormatDate(data[i].startTime);
							$.each(data[i].spanEventBoList, function(j, spanEventBo) {
								if(spanEventBo.exceptionId != 0) {
									exceptionFlag = true;
								}

							});

							if(exceptionFlag) {
								td = $("<tr onmouseover=\"this.style.background='White'\" onmouseout=\"this.style.background='#FFD2D2'\" style='background-color: #FFD2D2;' onClick=\"location.href='trans_info.html?exceptionFlag=" + exceptionFlag + "&traceId=" + data[i].transactionId.agentId + '%5E' + data[i].transactionId.agentStartTime + '%5E' + data[i].transactionId.transactionSequence + "&focusTimestamp=" + data[i].collectorAcceptTime +  "&agentId=" + data[i].agentId + "&spanId=" + data[i].spanId + "&mRpc=" + data[i].rpc + "'\"><td>" + (i + 1) +
									"<td><i class='fa fa-clock-o'></i> " + getFormatDate(data[i].startTime) +
									"<td>" + data[i].rpc +
									"</td><td class='text-danger'>异常</td><td class='text-navy'>" + data[i].elapsed +
									"</td><td>" + data[i].agentId +
									"</td><td>" + data[i].remoteAddr +
									"</td><td>" + data[i].transactionId.agentId + '%5E' + data[i].transactionId.agentStartTime + '%5E' + data[i].transactionId.transactionSequence + "</td></tr>");
								$("#rpc_tb").append(td);

							} else {
								if(data[i].elapsed < 1000) {
									td = $("<tr onClick=\"location.href='trans_info.html?traceId=" + data[i].transactionId.agentId + '%5E' + data[i].transactionId.agentStartTime + '%5E' + data[i].transactionId.transactionSequence + "&focusTimestamp=" + data[i].collectorAcceptTime +  "&agentId=" + data[i].agentId + "&spanId=" + data[i].spanId + "&mRpc=" + data[i].rpc + "'\"><td>" + (i + 1) +
										"<td><i class='fa fa-clock-o'></i> " + getFormatDate(data[i].startTime) +
										"<td>" + data[i].rpc +
										"</td><td>正常</td><td class='text-navy'>" + data[i].elapsed +
										"</td><td>" + data[i].agentId +
										"</td><td>" + data[i].remoteAddr +
										"</td><td>" + data[i].transactionId.agentId + '%5E' + data[i].transactionId.agentStartTime + '%5E' + data[i].transactionId.transactionSequence + "</td></tr>");
									$("#rpc_tb").append(td);
								} else if(data[i].elapsed > 5000) {
									td = $("<tr onClick=\"location.href='trans_info.html?traceId=" + data[i].transactionId.agentId + '%5E' + data[i].transactionId.agentStartTime + '%5E' + data[i].transactionId.transactionSequence + "&focusTimestamp=" + data[i].collectorAcceptTime +  "&agentId=" + data[i].agentId + "&spanId=" + data[i].spanId + "&mRpc=" + data[i].rpc + "'\"><td>" + (i + 1) +
										"<td><i class='fa fa-clock-o'></i> " + getFormatDate(data[i].startTime) +
										"<td>" + data[i].rpc +
										"</td><td>正常</td><td class='text-danger'>" + data[i].elapsed +
										"</td><td>" + data[i].agentId +
										"</td><td>" + data[i].remoteAddr +
										"</td><td>" + data[i].transactionId.agentId + '%5E' + data[i].transactionId.agentStartTime + '%5E' + data[i].transactionId.transactionSequence + "</td></tr>");
									$("#rpc_tb").append(td);
								} else {
									td = $("<tr onClick=\"location.href='trans_info.html?traceId=" + data[i].transactionId.agentId + '%5E' + data[i].transactionId.agentStartTime + '%5E' + data[i].transactionId.transactionSequence + "&focusTimestamp=" + data[i].collectorAcceptTime +  "&agentId=" + data[i].agentId + "&spanId=" + data[i].spanId + "&mRpc=" + data[i].rpc + "'\"><td>" + (i + 1) +
										"<td><i class='fa fa-clock-o'></i> " + getFormatDate(data[i].startTime) +
										"<td>" + data[i].rpc +
										"</td><td>正常</td><td class='text-warning'>" + data[i].elapsed +
										"</td><td>" + data[i].agentId +
										"</td><td>" + data[i].remoteAddr +
										"</td><td>" + data[i].transactionId.agentId + '%5E' + data[i].transactionId.agentStartTime + '%5E' + data[i].transactionId.transactionSequence + "</td></tr>");
									$("#rpc_tb").append(td);

								}

							}

						});
						$("#rpc_tb").append("</tbody>");
						$('#rpc_tb').dataTable({
							"aoColumnDefs": [{
								"bSortable": false,
								"aTargets": [0, 2, 3, 5, 6, 7]

							}]
						});
						rpcListFlag = true;
					});

				//				var serviceTypeCode = $("#app_choose").val();
				var from = startDate;
				var to = Date.parse(endDate);
//				console.log(new Date().getTime() + "----散点结束，拓扑图开始");

				$.get(preUrl + "/getServerMapDataDetail", {
						//				$.get("http://localhost:8041/getServerMapDataDetail", {
						applicationName: applicationName,
						serviceTypeCode: serviceTypeCode,
						from: from,
						to: to
					},
					function(data1) {

						var obj = JSON.parse(data1);

						var nodeArray = [];
						var linkArray = [];
						var temp1 = {
							symbol: 'image://http://www.damndigital.com/wp-content/uploads/2010/12/steve-jobs.jpg',
							symbolSize: [60, 35],
							draggable: true
						};
						nodeArray.push(temp1);

						var nodeList = obj.nodeDataArray;
						var linkList = obj.linkDataArray;
						var nodeMap = {};

						$.each(nodeList, function(i, item) {
							var RTSCount = 0;
							$.each(linkList, function(j, link) {
								if(item.key == link.from) {
									RTSCount = RTSCount + link.totalCount;
								}

							});

							if(applicationName == item.applicationName) {
								$("#applicationName").empty();
								$("#RTSCount").empty();
								$("#responseCount").empty();
								$("#errorCount").empty();
								$("#instanceCount").empty();

								$("#applicationName").append($('<h4 class="no-paging" >服务 : ' + item.applicationName + '</h4>'));
								$("#responseCount").append($('<h4>响应次数 : ' + item.totalCount + '</h4>'));
								$("#RTSCount").append($('<h4>RTS : ' + RTSCount + '</h4>'));
								//								$("#errorCount").append($('<h4 ><a id="error" onclick="errorList()" class="text-danger">Error : ' + item.errorCount + '</a></h4>'));
								//								$("#instanceCount").append($('<h4>实例数 : ' + item.instanceCount + '</h4>'));
								//								
								$("#errorCount").append($('<h4 ><a id="error" href="#rpc_tb"  onclick="errorList()" class="text-danger"><u>Error : ' + item.errorCount + '</u></a></h4>'));
								$("#instanceCount").append($("<h4>实例数 : " + item.instanceCount + "&nbsp;&nbsp;&nbsp;&nbsp;<a id='agentIds' href=\"agentInfo.html?applicationName=" + applicationName + "&startTimestamp=" + startDate + "&endTimestamp=" + Date.parse(endDate) + "&limit=" + limit + "\"><button>实例进程信息</button></h4>"));

							}

						});

						var xxx = 0;
						var yyy = 0;

						$.each(linkList, function(j, link) {
							$.each(nodeList, function(i, node) {
								yyy = Math.floor(Math.random() * 350 + 100);
								xxx = Math.floor(Math.random() * 500 + 150);

								if(node.key == link.from) {
									if(!(node.isWas)) {
										if(node.serviceTypeCode == 2 || node.serviceTypeCode == "2") {
											var sourceV = {
												category: 1,
												symbol: getImg(node.serviceTypeCode, node.applicationName),
												name: node.key,
												initial: [50, yyy],
												fixX: true,
												fixY: true,
												label: node.applicationName,
												value: 1
											};
										} else {
											var sourceV = {
												category: 1,
												symbol: getImg(node.serviceTypeCode, node.applicationName),
												name: node.key,
												initial: [700, yyy],
												fixX: true,
												fixY: true,
												label: node.applicationName,
												value: 1
											};
										}

									} else {
										var sourceV = {
											category: 1,
											symbol: getImg(node.serviceTypeCode, node.applicationName),
											name: node.key,
											label: node.applicationName,
											initial: [xxx, yyy],
											fixX: true,
											fixY: true,
											value: 1
										};

									}

									nodeMap[node.key] = sourceV;
									sourceK = node.key;
								} else if(node.key == link.to) {
									if(!(node.isWas)) {
										if(node.serviceTypeCode == 2 || node.serviceTypeCode == "2") {
											var targetV = {
												category: 1,
												symbol: getImg(node.serviceTypeCode, node.applicationName),
												name: node.key,
												initial: [50, yyy],
												fixX: true,
												fixY: true,
												label: node.applicationName,
												value: 1
											};
										} else {
											var targetV = {
												category: 1,
												symbol: getImg(node.serviceTypeCode, node.applicationName),
												name: node.key,
												initial: [700, yyy],
												fixX: true,
												fixY: true,
												label: node.applicationName,
												value: 1
											};
										}

									} else {
										var targetV = {
											category: 1,
											symbol: getImg(node.serviceTypeCode, node.applicationName),
											name: node.key,
											label: node.applicationName,
											initial: [xxx, yyy],
											fixX: true,
											fixY: true,
											value: 1
										};

									}

									nodeMap[node.key] = targetV;
									targetK = node.key;
								}
							});
							linkData = {
								source: sourceK,
								target: targetK,
								weight: 2,
								itemStyle: {
									normal: {

										color: '#D3D3D3',

										text: link.totalCount,
										textColor: '#D3D3D3',
										textFont: 'bold 15px verdana',
										textPosition: 'inside'
									}
								}
							};
							linkArray.push(linkData);
						});

						//						nodeArray = ClearNullArr(nodeArray);

						$.each(nodeMap, function(i, node) {
							if(node.name == getKeyByName(getNameByKey(params.name))) {
								node.symbol = getImg2("1210", getNameByKey(params.name));
							}

						});

						for(var key in nodeMap) {

							nodeArray.push(nodeMap[key]);
						}

						//						console.log(JSON.stringify(nodeArray));
						//						console.log(JSON.stringify(linkArray));

						var nodeMap2 = {};
						var nodeName = params.name;
						$.each(nodeArray, function(j, node) {
							if(nodeName == node.name) {
								nodeMap2[nodeName] = node;

							}

						});

						//						for(var a = 0; a < linkArray.length; a++) {

						var tempArrayList = getNode1(nodeName, linkArray);
						$.each(tempArrayList, function(i, item) {
							$.each(nodeArray, function(j, node) {
								if(item == node.name) {
									nodeMap2[item] = node;

								}

							});

							var temp1 = getNode1(item, linkArray);
							$.each(temp1, function(k, item1) {
								$.each(nodeArray, function(l, node1) {
									if(item1 == node1.name) {
										nodeMap2[item1] = node1;

									}

								});
								var temp2 = getNode1(item1, linkArray);
								$.each(temp2, function(m, item2) {
									$.each(nodeArray, function(l, node1) {
										if(item2 == node1.name) {
											nodeMap2[item2] = node1;

										}

									});
								});
							});

						});

						var tempTargetList = getNodeByTarget1(nodeName, linkArray);
						$.each(tempTargetList, function(i, item) {
							$.each(nodeArray, function(j, node) {
								if(item == node.name) {
									nodeMap2[item] = node;

								}

							});

							var temp1 = getNodeByTarget1(item, linkArray);
							$.each(temp1, function(k, item1) {
								$.each(nodeArray, function(l, node1) {
									if(item1 == node1.name) {
										nodeMap2[item1] = node1;

									}

								});

								var temp2 = getNodeByTarget1(item1, linkArray);
								$.each(temp2, function(m, item2) {
									$.each(nodeArray, function(l, node1) {
										if(item2 == node1.name) {
											nodeMap2[item2] = node1;

										}

									});
								});
							});

						});

						//						console.log(JSON.stringify(tempArrayList));
						//						console.log(JSON.stringify(nodeMap2));
						var nodeArray1 = [];

						$.each(nodeMap2, function(i, node) {
							if(node.name == getKeyByName(getNameByKey(params.name))) {
								node.symbol = getImg2("1210", getNameByKey(params.name));
							}

						});

						for(var key in nodeMap2) {

							nodeArray1.push(nodeMap2[key]);
						}

						function getNodeByName(name) {
							$.each(nodeArray, function(j, node) {
								if(name == node.name) {
									return node;
								}

							});
						}

						function getNode1(nodeName, linkArray) {
							var tempNodeArray = [];
							$.each(linkArray, function(i, link) {
								if(nodeName == link.source) {
									tempNodeArray.push(link.target);
								}

							});
							return tempNodeArray;
						}

						function getNodeByTarget1(nodeName, linkArray) {
							//							console.log(JSON.stringify(linkArray));
							var tempNodeArray = [];
							$.each(linkArray, function(i, link) {
								if(nodeName == link.target) {
									tempNodeArray.push(link.source);
								}

							});
							return tempNodeArray;
						}

						function getKeyByName(name) {
							var key;
							$.each(nodeList, function(j, node) {
								if(name == node.applicationName) {
									key = node.key;
								}

							});

							return key;
						}
						//					
						var textName = "全栈调用链";
						if($("#showType").val() == 1 || $("#showType").val() == "1") {
							nodeArray = nodeArray1;
							textName = "基于服务调用链";
						}

						var myChart = echarts.init(document.getElementById("rpc_link_chart"));
						var option = {
							title: {
								text: textName
							},

							toolbox: {
								show: true,
								feature: {
									restore: {
										show: true
									}
								}
							},
							series: [{
								type: 'force',
								name: "服务",
								ribbonType: false,

								itemStyle: {
									normal: {
										label: {
											show: true,
											position: 'bottom',
											textStyle: {
												color: 'black',
												baseline: 'left',
												fontStyle: 'normal', //文字字体的风格 'normal'标准 'italic'斜体 'oblique' 倾斜
												fontWeight: 'bolder', //'normal'标准'bold'粗的'bolder'更粗的'lighter'更细的或100 | 200 | 300 | 400...
												fontFamily: 'sans-serif', //文字的字体系列
												fontSize: 12 //字体大小
											}
										},
										nodeStyle: {

											borderColor: 'red',
											borderWidth: 2
										}
									},
									emphasis: {
										label: {
											show: false
												// textStyle: null      // 默认使用全局文本样式，详见TEXTSTYLE
										},
										nodeStyle: {
											// r: 30

										},
										linkStyle: {}
									}
								},

								gravity: 0.5,
								scaling: 1.6,
								draggable: true,
								linkSymbol: 'arrow',
								symbolSize: 30,
								linkSymbolSize: [10, 15],
								steps: 10,
								coolDown: 0.9,
								//preventOverlap: true,
								nodes: nodeArray,

								links: linkArray
							}]
						};
						var barChart = echarts.init(document.getElementById("rpc_bar_chart"));
						var countArray = [];
						$.each(nodeList, function(i, item) {
							if(applicationName == item.applicationName) {

								countArray.push(item.histogram['1s']);
								countArray.push(item.histogram['3s']);
								countArray.push(item.histogram['5s']);
								countArray.push(item.histogram.Slow);
								countArray.push(item.histogram.Error);
							}
						});

						var barOption = {

							tooltip: {
								trigger: 'axis'
							},

							calculable: true,
							grid: {
								x: 40,
								x2: 15,
								y: 20,
								y2: 60
							},
							xAxis: [{
								type: 'category',
								data: ["1s", "3s", "5s", "Slow", "Error"],
							}],
							yAxis: [{
								type: 'value'
							}],
							series: [{
									name: '次数',
									type: 'bar',
									itemStyle: {
										normal: {
											color: function(params) {
												// build a color map as your need.
												var colorList = [
													'#ADD8E6', '#B0E0E6', '	#90EE90', '	#FFD700', '	#FF0000'
												];
												return colorList[params.dataIndex]
											},
											label: {
												show: true,
												position: 'top'

											}
										}
									},
									data: countArray
								},

							]
						};

						barChart.setOption(barOption);

						myChart.setOption(option);

						myChart.on('click', function(params) {
							tableShow2(params);
						});

						function focus(param) {
							var data = param.data;
							var links = option.series[0].links;
							var nodes = option.series[0].nodes;
							if(
								data.source != null &&
								data.target != null
							) { //点击的是边
								var sourceNode = nodes.filter(function(n) {
									return n.name == data.source
								})[0];
								var targetNode = nodes.filter(function(n) {
									return n.name == data.target
								})[0];
								console.log("选中了边 " + sourceNode.name + ' -> ' + targetNode.name + ' (' + data.weight + ')');
							} else { // 点击的是点
								console.log("选中了" + data.name + '(' + data.value + ')');
							}
						}

					});

				setCookie("applicationName", applicationName, 30);
//				console.log(new Date().getTime() + "----点击事件结束时间");

			}